using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmUploadLocalNote : Form
	{
		private IContainer components = null;
		private ImageList imageList;
		private Button btnUpload;
		private ProgressBar progressBar;
		private SplitContainer splitContainer;
		private ListView listViewNote;
		private RichTextBox rtboxinfo;
		private Label lbInfo;
		private Button btnCancel;
		private ContextMenuStrip contextMenuStrip;
		private ToolStripMenuItem pmDelete;
		private TWorkNoteItem[] aNoteItems = new TWorkNoteItem[0];
		private string _sourcefilename = "";
		private string _destfilename = "";
		private NoteRemote _NoteRemoteObject = null;
		private TLoginInfo _LoginInfo = new TLoginInfo();
		private bool _NeedRefresh = false;
		public NoteRemote NoteRemoteObject
		{
			set
			{
				this._NoteRemoteObject = value;
			}
		}
		public TLoginInfo LoginInfo
		{
			set
			{
				this._LoginInfo = value;
			}
		}
		public bool NeedRefresh
		{
			get
			{
				return this._NeedRefresh;
			}
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmUploadLocalNote));
			this.imageList = new ImageList(this.components);
			this.btnUpload = new Button();
			this.progressBar = new ProgressBar();
			this.splitContainer = new SplitContainer();
			this.listViewNote = new ListView();
			this.rtboxinfo = new RichTextBox();
			this.lbInfo = new Label();
			this.btnCancel = new Button();
			this.contextMenuStrip = new ContextMenuStrip(this.components);
			this.pmDelete = new ToolStripMenuItem();
			this.splitContainer.Panel1.SuspendLayout();
			this.splitContainer.Panel2.SuspendLayout();
			this.splitContainer.SuspendLayout();
			this.contextMenuStrip.SuspendLayout();
			base.SuspendLayout();
			this.imageList.ImageStream = (ImageListStreamer)componentResourceManager.GetObject("imageList.ImageStream");
			this.imageList.TransparentColor = System.Drawing.Color.Transparent;
			this.imageList.Images.SetKeyName(0, "icon84.ico");
			this.imageList.Images.SetKeyName(1, "icon61.ico");
			this.imageList.Images.SetKeyName(2, "icon39.ico");
			this.imageList.Images.SetKeyName(3, "icon76.ico");
			this.btnUpload.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.btnUpload.Location = new System.Drawing.Point(2, 410);
			this.btnUpload.Name = "btnUpload";
			this.btnUpload.Size = new System.Drawing.Size(107, 23);
			this.btnUpload.TabIndex = 9;
			this.btnUpload.TabStop = false;
			this.btnUpload.Text = "上传至服务器(&U)";
			this.btnUpload.UseVisualStyleBackColor = true;
			this.btnUpload.Click += new EventHandler(this.btnUpload_Click);
			this.progressBar.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.progressBar.Location = new System.Drawing.Point(115, 410);
			this.progressBar.Name = "progressBar";
			this.progressBar.Size = new System.Drawing.Size(496, 23);
			this.progressBar.TabIndex = 10;
			this.progressBar.UseWaitCursor = true;
			this.progressBar.Value = 45;
			this.progressBar.Visible = false;
			this.splitContainer.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.splitContainer.Location = new System.Drawing.Point(1, 1);
			this.splitContainer.Name = "splitContainer";
			this.splitContainer.Orientation = Orientation.Horizontal;
			this.splitContainer.Panel1.Controls.Add(this.listViewNote);
			this.splitContainer.Panel2.Controls.Add(this.rtboxinfo);
			this.splitContainer.Panel2.Controls.Add(this.lbInfo);
			this.splitContainer.Size = new System.Drawing.Size(688, 403);
			this.splitContainer.SplitterDistance = 265;
			this.splitContainer.TabIndex = 14;
			this.splitContainer.TabStop = false;
			this.listViewNote.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.listViewNote.ContextMenuStrip = this.contextMenuStrip;
			this.listViewNote.FullRowSelect = true;
			this.listViewNote.Location = new System.Drawing.Point(3, 3);
			this.listViewNote.Name = "listViewNote";
			this.listViewNote.Size = new System.Drawing.Size(682, 259);
			this.listViewNote.SmallImageList = this.imageList;
			this.listViewNote.TabIndex = 9;
			this.listViewNote.TabStop = false;
			this.listViewNote.UseCompatibleStateImageBehavior = false;
			this.listViewNote.View = View.Details;
			this.rtboxinfo.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rtboxinfo.Font = new System.Drawing.Font("宋体", 12f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.rtboxinfo.Location = new System.Drawing.Point(2, 20);
			this.rtboxinfo.Name = "rtboxinfo";
			this.rtboxinfo.Size = new System.Drawing.Size(683, 112);
			this.rtboxinfo.TabIndex = 0;
			this.rtboxinfo.Text = "";
			this.lbInfo.AutoSize = true;
			this.lbInfo.Font = new System.Drawing.Font("宋体", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.lbInfo.Location = new System.Drawing.Point(2, 2);
			this.lbInfo.Name = "lbInfo";
			this.lbInfo.Size = new System.Drawing.Size(53, 12);
			this.lbInfo.TabIndex = 15;
			this.lbInfo.Text = "上传信息";
			this.btnCancel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.btnCancel.Location = new System.Drawing.Point(612, 408);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(75, 26);
			this.btnCancel.TabIndex = 17;
			this.btnCancel.Text = "关闭(&C)";
			this.btnCancel.UseVisualStyleBackColor = true;
			this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
			this.contextMenuStrip.Items.AddRange(new ToolStripItem[]
			{
				this.pmDelete
			});
			this.contextMenuStrip.Name = "contextMenuStrip";
			this.contextMenuStrip.Size = new System.Drawing.Size(137, 26);
			this.pmDelete.Name = "pmDelete";
			this.pmDelete.ShortcutKeys = Keys.Delete;
			this.pmDelete.Size = new System.Drawing.Size(152, 22);
			this.pmDelete.Text = "删除";
			this.pmDelete.Click += new EventHandler(this.pmDelete_Click);
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new System.Drawing.Size(690, 437);
			base.Controls.Add(this.btnCancel);
			base.Controls.Add(this.splitContainer);
			base.Controls.Add(this.progressBar);
			base.Controls.Add(this.btnUpload);
			base.Name = "FrmUploadLocalNote";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "上传本地日志";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.FrmUploadLocalNote_Load);
			this.splitContainer.Panel1.ResumeLayout(false);
			this.splitContainer.Panel2.ResumeLayout(false);
			this.splitContainer.Panel2.PerformLayout();
			this.splitContainer.ResumeLayout(false);
			this.contextMenuStrip.ResumeLayout(false);
			base.ResumeLayout(false);
		}
		private void ReadLocalWorkNotesConfig()
		{
			try
			{
				RegistryKey localMachine = Registry.LocalMachine;
				RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
				object value = registryKey.GetValue("NoteClientStartPath");
				if (value != null)
				{
					this._sourcefilename = Convert.ToString(value) + "\\LocalWorkNotes.mdb";
				}
				value = registryKey.GetValue("WorkNotesAutoBackupPath");
				if (value != null)
				{
					this._destfilename = Convert.ToString(value) + "\\LocalWorkNotes.mdb";
				}
			}
			catch
			{
			}
		}
		public FrmUploadLocalNote()
		{
			this.InitializeComponent();
			this.CreateColumn();
			this.ReadLocalWorkNotesConfig();
		}
		private static Array ChangeArrayLength(Array oriArray, int Count)
		{
			Type elementType = oriArray.GetType().GetElementType();
			Array array = Array.CreateInstance(elementType, Count);
			Array.Copy(oriArray, 0, array, 0, Math.Min(oriArray.Length, Count));
			return array;
		}
		private static Array ChangeArrayLength(Array oriArray, int Row, int Col)
		{
			Type elementType = oriArray.GetType().GetElementType();
			Array array = Array.CreateInstance(elementType, Row, Col);
			Array.Copy(oriArray, 0, array, 0, Math.Min(oriArray.Length, Row * Col));
			return array;
		}
		private void CreateColumn()
		{
			ColumnHeader columnHeader = new ColumnHeader();
			columnHeader.Text = "日期";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "主题";
			columnHeader.Width = 200;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "工作量";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "正文";
			columnHeader.Width = 200;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "创建日期";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "创建时间";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.listViewNote.Columns.Add(columnHeader);
		}
		private string GetNoteClientStartPath()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("NoteClientStartPath");
			string result;
			if (value == null)
			{
				result = "";
			}
			else
			{
				result = value.ToString();
			}
			return result;
		}
		private bool GetNeedUploadNoteList(ref TWorkNoteItem[] aNoteItems, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "查询需要上传的日志列表失败！数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string text = "select [NoteTopic],[NoteBody],[NoteDate],[WorkLoad],[CreateDate],[CreateTime],[BeginTime],[EndTime],[NoteIndex],[TaskID] from [NoteList] where UploadFlag = 0";
				array = localAccess.Open(text);
				if (localAccess.Message != "")
				{
					aErrMsg = "查询需要上传的日志列表失败！" + localAccess.Message + "\nSQL语句=" + text;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					aNoteItems = (TWorkNoteItem[])FrmUploadLocalNote.ChangeArrayLength(aNoteItems, num);
					for (int i = 0; i < aNoteItems.Length; i++)
					{
						aNoteItems[i] = new TWorkNoteItem();
					}
					for (int i = 0; i < num; i++)
					{
						aNoteItems[i].NoteTopic = array[i, 0];
						aNoteItems[i].NoteBody = array[i, 1];
						aNoteItems[i].NoteDate = array[i, 2];
						aNoteItems[i].WorkLoad = array[i, 3];
						aNoteItems[i].CreateDate = array[i, 4];
						aNoteItems[i].CreateTime = array[i, 5];
						aNoteItems[i].BeginTime = array[i, 6];
						aNoteItems[i].EndTime = array[i, 7];
						aNoteItems[i].NoteIndex = array[i, 8];
						aNoteItems[i].TaskID = array[i, 9];
					}
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private bool SetNoteUploadFlag(string aNoteIndex, string aUploadFlag, ref string aErrMsg)
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "更新本地日志上传标志失败！数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "update NoteList set UploadFlag = " + aUploadFlag + " where NoteIndex=" + aNoteIndex;
				int num = localAccess.ExecSQL(aStrSql);
				if (num != 1)
				{
					aErrMsg = "更新本地日志上传标志失败！" + localAccess.Message;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private void UseNeedUploadNoteListDataFillListview()
		{
			string text = "";
			if (this._LoginInfo.LoginSuccess)
			{
				this.listViewNote.Items.Clear();
				if (this.GetNeedUploadNoteList(ref this.aNoteItems, ref text))
				{
					int num = this.aNoteItems.GetUpperBound(0) - this.aNoteItems.GetLowerBound(0) + 1;
					for (int i = 0; i < num; i++)
					{
						ListViewItem listViewItem = new ListViewItem();
						listViewItem.Text = this.aNoteItems[i].NoteDate;
						listViewItem.SubItems.Add(this.aNoteItems[i].NoteTopic);
						listViewItem.SubItems.Add(this.aNoteItems[i].WorkLoad);
						listViewItem.SubItems.Add(this.aNoteItems[i].NoteBody);
						listViewItem.SubItems.Add(this.aNoteItems[i].CreateDate);
						listViewItem.SubItems.Add(this.aNoteItems[i].CreateTime);
						listViewItem.ImageIndex = 0;
						this.listViewNote.Items.Add(listViewItem);
					}
					this.btnUpload.Enabled = (this.listViewNote.Items.Count != 0);
				}
				else
				{
					MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
			}
		}
		private void FrmUploadLocalNote_Load(object sender, EventArgs e)
		{
			this.UseNeedUploadNoteListDataFillListview();
		}
		private void GetExpandFieldsPara(string aNoteIndex, ref string aParaString, ref int aParaCount)
		{
			aParaString = "";
			aParaCount = 0;
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			if (!localAccess.Connected)
			{
				GC.Collect();
			}
			else
			{
				string text = "select FieldCode,FieldValue from WorkNotesExpand where NoteIndex = " + aNoteIndex;
				array = localAccess.Open(text);
				if (localAccess.Message != "")
				{
					string text2 = "查询失败！" + localAccess.Message + "\nSQL语句=" + text;
					localAccess.DisConnect();
					GC.Collect();
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
					for (int i = 0; i <= num - 1; i++)
					{
						aParaString = string.Concat(new string[]
						{
							aParaString,
							array[i, 0],
							"~",
							array[i, 1],
							"|"
						});
						aParaCount++;
					}
					localAccess.DisConnect();
					GC.Collect();
				}
			}
		}
		private void btnUpload_Click(object sender, EventArgs e)
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			string text = "";
			if (this.rtboxinfo.CanFocus)
			{
				this.rtboxinfo.Focus();
			}
			if (this._LoginInfo.LoginSuccess)
			{
				this.UseNeedUploadNoteListDataFillListview();
				if (this.listViewNote.Items.Count != 0)
				{
					this.btnUpload.Enabled = false;
					this.progressBar.Minimum = 1;
					this.progressBar.Maximum = this.listViewNote.Items.Count;
					this.progressBar.Visible = true;
					for (int i = 0; i < this.listViewNote.Items.Count; i++)
					{
						Application.DoEvents();
						ListViewItem listViewItem = this.listViewNote.Items[i];
						listViewItem.ImageIndex = 1;
						Application.DoEvents();
						Thread.Sleep(100);
						this.progressBar.Value = i + 1;
						bool flag = false;
						try
						{
							string aParaString = "";
							int num = 0;
							this.GetExpandFieldsPara(this.aNoteItems[i].NoteIndex, ref aParaString, ref num);
							flag = this._NoteRemoteObject.EditNote(this._LoginInfo.LoginID, this.aNoteItems[i].NoteTopic, this.aNoteItems[i].NoteBody, this.aNoteItems[i].NoteDate, this.aNoteItems[i].WorkLoad, this.aNoteItems[i].BeginTime, this.aNoteItems[i].EndTime, "", true, this.aNoteItems[i].TaskID, aParaString, num.ToString(), ref text);
						}
						catch (Exception ex)
						{
							MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
						if (flag)
						{
							string text2 = DateTime.Now.ToString("yyyy-MM-dd");
							text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
							text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
							string text3 = text2;
							text2 = string.Concat(new string[]
							{
								text3,
								" 日志<",
								this.aNoteItems[i].NoteDate,
								",",
								this.aNoteItems[i].NoteTopic,
								">已成功上传至服务器！\n"
							});
							this.rtboxinfo.AppendText(text2);
							listViewItem.ImageIndex = 2;
							if (this.SetNoteUploadFlag(this.aNoteItems[i].NoteIndex, "1", ref text))
							{
								text2 = DateTime.Now.ToString("yyyy-MM-dd");
								text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
								text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
								text3 = text2;
								text2 = string.Concat(new string[]
								{
									text3,
									" 日志<",
									this.aNoteItems[i].NoteDate,
									",",
									this.aNoteItems[i].NoteTopic,
									">本地上传标志更新成功！\n"
								});
								this.rtboxinfo.AppendText(text2);
							}
							else
							{
								text2 = DateTime.Now.ToString("yyyy-MM-dd");
								text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
								text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
								text3 = text2;
								text2 = string.Concat(new string[]
								{
									text3,
									" 日志<",
									this.aNoteItems[i].NoteDate,
									",",
									this.aNoteItems[i].NoteTopic,
									">本地上传标志更新失败！",
									text,
									"\n"
								});
								this.rtboxinfo.AppendText(text2);
							}
							this._NeedRefresh = true;
						}
						else
						{
							string text2 = DateTime.Now.ToString("yyyy-MM-dd");
							text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
							text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
							string text3 = text2;
							text2 = string.Concat(new string[]
							{
								text3,
								" 日志<",
								this.aNoteItems[i].NoteDate,
								",",
								this.aNoteItems[i].NoteTopic,
								">上传至服务器时发生错误！",
								text,
								"\n"
							});
							this.rtboxinfo.AppendText(text2);
							listViewItem.ImageIndex = 3;
							if (this.SetNoteUploadFlag(this.aNoteItems[i].NoteIndex, "0", ref text))
							{
								text2 = DateTime.Now.ToString("yyyy-MM-dd");
								text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
								text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
								text3 = text2;
								text2 = string.Concat(new string[]
								{
									text3,
									" 日志<",
									this.aNoteItems[i].NoteDate,
									",",
									this.aNoteItems[i].NoteTopic,
									">本地上传标志更新成功！\n"
								});
								this.rtboxinfo.AppendText(text2);
							}
							else
							{
								text2 = DateTime.Now.ToString("yyyy-MM-dd");
								text2 = text2 + " " + DateTime.Now.ToString("HH:mm:ss");
								text2 = text2 + ":" + DateTime.Now.Millisecond.ToString("000");
								text3 = text2;
								text2 = string.Concat(new string[]
								{
									text3,
									" 日志<",
									this.aNoteItems[i].NoteDate,
									",",
									this.aNoteItems[i].NoteTopic,
									">本地上传标志更新失败！",
									text,
									"\n"
								});
								this.rtboxinfo.AppendText(text2);
							}
						}
						this.btnUpload.Enabled = true;
					}
					this.AutoBackup();
					this.progressBar.Visible = false;
				}
			}
		}
		private bool AutoBackup()
		{
			bool result;
			try
			{
				File.Copy(this._sourcefilename, this._destfilename, true);
				result = true;
			}
			catch
			{
				result = false;
			}
			return result;
		}
		private void btnCancel_Click(object sender, EventArgs e)
		{
			base.Close();
		}
		private bool DeleteLocalNote(string aNoteIndex, ref string aErrMsg)
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(this.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "删除本地日志失败！数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from NoteList where NoteIndex = " + aNoteIndex;
				int num = localAccess.ExecSQL(aStrSql);
				if (num != 1)
				{
					aErrMsg = "删除本地日志失败！" + localAccess.Message;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = true;
				}
			}
			return result;
		}
		private void pmDelete_Click(object sender, EventArgs e)
		{
			if (this.listViewNote.SelectedItems.Count == 0)
			{
				MessageBox.Show("未选择欲删除项！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			else
			{
				if (MessageBox.Show("确定要删除所选择项？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
				{
					int num = this.listViewNote.SelectedIndices[0];
					string noteIndex = this.aNoteItems[num].NoteIndex;
					string text = "";
					if (!this.DeleteLocalNote(noteIndex, ref text))
					{
						MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
					else
					{
						this.UseNeedUploadNoteListDataFillListview();
					}
				}
			}
		}
	}
}
